<?php
include('top.php');
require_once('pasmy/dbwaarden.php');
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);

if(isset($_POST["opwaarderen"])) {
/*foreach($_POST as $key => $value) 
{
	echo "sleutel = $key en waarde = $value<br>";
}
foreach($_GET as $key => $value) 
{
	echo "GET sleutel = $key en waarde = $value<br>";
}*/
$datum = $_POST["datum"];
$d1 = explode("-",$datum);
$waardb = $_POST["dbnaam"];
$ref = addslashes($_POST["ref"]);$ref = strtoupper($ref);
$client = addslashes($_POST["client"]);$client = strtolower($client);$client = ucwords($client);
$expediteur = addslashes($_POST["exp"]);$expediteur = strtolower($expediteur);$expediteur = ucwords($expediteur);
$bestemmeling = addslashes($_POST["best"]);$bestemmeling = strtolower($bestemmeling);$bestemmeling = ucwords($bestemmeling);
$plaats = addslashes($_POST["ville"]);$plaats = strtolower($plaats);$plaats = ucwords($plaats);
$laadplaats = addslashes($_POST["laadplaats"]);$laadplaats = strtolower($laadplaats);$laadplaats = ucwords($laadplaats);
$colis = addslashes($_POST["colis"]);
$pal = addslashes($_POST["pal"]);
$mp = addslashes($_POST["mp"]);
$poids = addslashes($_POST["poids"]);
$prijs = addslashes($_POST["prix"]);
$opmerkingen = addslashes($_POST["opm"]);
$driver = addslashes($_POST["driver"]);
$week = addslashes($_POST["week"]);
$record = addslashes($_POST["id"]);
$prijs=number_format($prijs,2);

 
$sql = "delete from $waardb where record = '$record'";
 
if($_SESSION['login'] == "0") {
//echo "<strong>sql = $sql</strong><br>";
}

$res = mysql_query($sql, $mysql_id);
fout($mysql_id);
?>
<br /><br /><h1><div style="text-align: center">Entry deleted !</div></h1>
<?php
}	
else {
?>
	<font size="8" color="#FF0000"><div style="text-align: center">Si tu continues, les donn&eacute;es seront supprim&eacute;es dans la base de donn&eacute;e !</div></font>
<?php
$id = $_GET["nr"];
$waardb = $_GET["jaren"];
/*foreach($_POST as $key => $value) {
	echo "sleutel = $key en waarde = $value<br>";
	}*/
	

$sql = "select lang from chauffeurs";
$res = mysql_query($sql, $mysql_id);
$teller = 0;
while ($row = mysql_fetch_row($res)) {
		$drivers[$teller] = $row[0];
		$teller++;
	}

$sql = "select * from $waardb where record = '$id'";
$res = mysql_query($sql, $mysql_id);
?>
<form action="deleten.php" method="POST">
<table width="40%">
<?php
while ($row = mysql_fetch_row($res)) {
	
	echo "<tr><td width='20%'><strong>Datum</strong></td><td width='20%'><input type='text' size='40' name='datum' value=" . '"' . $row[0] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Reference</strong></td><td width='20%'><input type='text' size='40' name='ref' value=" . '"' . $row[1] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Client</strong></td><td width='20%'><input type='text' size='40' name='client' value=" . '"' . $row[2] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Expediteur</strong></td><td width='20%'><input type='text' size='40' name='exp' value=" . '"' . $row[3] .'"' . "></td></tr>\n";
	
	echo "<tr><td width='20%'><strong>Laadplaats</strong></td><td width='20%'><input type='text' size='40' name='laadplaats' value=" . '"' . $row[15] .'"' . "></td></tr>\n";
	
	
	echo "<tr><td width='20%'><strong>Destinataire</strong></td><td width='20%'><input type='text' size='40' name='best' value=" . '"' . $row[4] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Ville</strong></td><td width='20%'><input type='text' size='40' name='ville' value=" . '"' . $row[5] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Colis</strong></td><td width='20%'><input type='text' size='40' name='colis' value=" . '"' . $row[6] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Palettes</strong></td><td width='20%'><input type='text' size='40' name='pal' value=" . '"' . $row[7] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Metres planche</strong></td><td width='20%'><input type='text' size='40' name='mp' value=" . '"' . $row[8] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Poids</strong></td><td width='20%'><input type='text' size='40' name='poids' value=" . '"' . $row[9] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Prix</strong></td><td width='20%'><input type='text' size='40' name='prix' value=" . '"' . $row[10] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Remarques</strong></td><td width='20%'><input type='text' size='40' name='opm' value=" . '"' . $row[11] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Chauffeur</strong></td><td width='20%'><input type='text' size='40' name='driver' value=" . '"' . $row[12] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'><strong>Semaine</strong></td><td width='20%'><input type='text' size='40' name='week' value=" . '"' . $row[13] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'></td>&nbsp;<td width='20%'><input type='hidden' name='id' value=" . '"' . $row[14] .'"' . "></td></tr>\n";
	echo "<tr><td width='20%'></td>&nbsp;<td width='20%'><input type='hidden' name='dbnaam' value=" . '"' . $waardb .'"' . "></td></tr>\n";
	
}



?>
<tr><td colspan="2"><br /><div style="text-align: center"><input type="submit" name="opwaarderen" value="Supprimer !" /></div></td></tr>
</table>
</form>

<?php
}
include('footer.php');
?>